package com.crm.consult.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.crm.annotation.SystemServiceLog;
import com.crm.model.ConsultInfoManagePay;
import com.crm.service.ConsultInfoManagePayService;
import com.crm.util.AopConfig;

@Controller
@RequestMapping("/consultInfoManagePay")
public class ConsultInfoManagePayController {
	private static String PY="PY";
	@Autowired
	private ConsultInfoManagePayService consultInfoManagePayService;
	
	/**
	 * 
	 * @Description : 新增修改记录
	 * @author zealot
	 * @param @param record
	 * @param @return
	 * @return Map<String,Object>
	 * @version 创建时间 : 2016年12月2日 上午10:00:59
	 * @thorws
	 */
	@SystemServiceLog(description=AopConfig.INFOMANAGEPAY+AopConfig.ADD,type=AopConfig.ADD)
	@RequestMapping("/addNewRecord")
	@ResponseBody
	public Map<String, Object> addNewRecord(ConsultInfoManagePay record){
		
		Map<String, Object> map = new HashMap<>();
		record.setInfoManagePay(PY+System.nanoTime()/1000);
		consultInfoManagePayService.insert(record);
		map.put("status", "success");
		map.put("msg", "新增成功！");
		return map;
	}
}

